.custom-modal-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10000;
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  transition: opacity 0.3s ease, backdrop-filter 0.3s ease;
  
  &.show {
    opacity: 1;
  }
  
  &.hide {
    opacity: 0;
  }


  &.center {
    align-items: center;
    justify-content: center;
  }

  &.top {
    align-items: flex-start;
    justify-content: center;
    padding-top: 100px;
  }

  &.bottom {
    align-items: flex-end;
    justify-content: center;
    padding-bottom: 100px;
  }
}

.custom-modal {
  position: relative;
  background-image: url('@/assets/images/modalBackground.png');
  background-size: 100% 100%;
  background-repeat: no-repeat;
  background-position: center;
  border-radius: 20px;
  max-width: 320px;
  width: 90%;
  max-height: 80vh;
  transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  
  &.show {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
  
  &.hide {
    opacity: 0;
    transform: scale(0.8) translateY(-20px);
  }

  &.center {
    &.show {
      transform: scale(1) translateY(0);
    }
    &.hide {
      transform: scale(0.8) translateY(-20px);
    }
  }

  &.top {
    &.show {
      transform: scale(1) translateY(0);
    }
    &.hide {
      transform: scale(0.8) translateY(-40px);
    }
  }

  &.bottom {
    &.show {
      transform: scale(1) translateY(0);
    }
    &.hide {
      transform: scale(0.8) translateY(40px);
    }
  }

  .modal-background {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    opacity: 0.2;
    z-index: 1;
    .background-image {
      width: 100%;
      height: 100%;
      object-fit: cover;
      border-radius: 20px;
    }
  }

  .modal-content {
    position: relative;
    z-index: 2;
    padding: 30px 20px 20px;
    text-align: center;
    transition: all 0.3s ease;
    
    .modal-icon {
      transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    }
    
    .modal-title {
      transition: all 0.3s ease 0.1s;
    }
    
    .modal-message {
      transition: all 0.3s ease 0.15s;
    }
    
    .modal-actions {
      transition: all 0.3s ease 0.2s;
    }
  }
  
  &.hide .modal-content {
    .modal-icon {
      transform: scale(0.8) rotate(-10deg);
      opacity: 0.7;
    }
    
    .modal-title {
      transform: translateY(-10px);
      opacity: 0.8;
    }
    
    .modal-message {
      transform: translateY(-5px);
      opacity: 0.6;
    }
    
    .modal-actions {
      transform: translateY(10px);
      opacity: 0.7;
    }
  }
    
    // 星星装饰样式 - 围绕addressIcon居中
    .stars-decoration {
      position: absolute;
      top: -20px; // 与modal-icon的top: -28px对齐
      left: 50%;
      transform: translateX(-50%);
      width: 100px;
      height: 100px;
      pointer-events: none;
      z-index: 1;
      
      .star {
        position: absolute;
        font-size: 16px;
        color: #5d9dff;
        animation: twinkle 2s infinite ease-in-out;
        
        &.star-1 {
          top: 15px;
          right: 10px;
          animation-delay: 0s;
        }
        
        &.star-2 {
          top: 15px;
          left: 10px;
          animation-delay: 0.4s;
        }
        
        &.star-3 {
          top: 45px;
          left: 50%;
          transform: translateX(-50%);
          animation-delay: 0.8s;
        }
        
        &.star-4 {
          top: 75px;
          right: 15px;
          animation-delay: 1.2s;
        }
        
        &.star-5 {
          top: 75px;
          left: 15px;
          animation-delay: 1.6s;
        }
      }
    }
    
    .modal-icon {
      position: relative;
      top: -28px;
      margin: 0 auto;
      z-index: 2;
      
      .icon-image {
        width: 80px;
        height: 80px;
        display: block;
        margin: 0 auto;
        position: relative;
        z-index: 100;
      }
      
      // success图标覆盖层
      .success-overlay {
        position: absolute;
        top: 50%;
        left: 50%;
        .success-image {
          width: 220px;
          height: 220px;
          animation: successPulse 1.5s infinite ease-in-out;
        }
      }
    }

    .modal-title {
      font-size: 20px;
      font-weight: 600;
      color: #333;
      margin-bottom: 12px;
      line-height: 1.3;
    }

    .modal-message {
      font-size: 14px;
      color: #666;
      line-height: 1.5;
      margin-bottom: 24px;
      padding: 0 10px;
    }

    .modal-children {
      margin-bottom: 20px;
    }

    .modal-actions {
      display: flex;
      gap: 12px;
      justify-content: center;

      .modal-button {
        flex: 1;
        padding: 12px 20px;
        border-radius: 25px;
        font-size: 14px;
        font-weight: 500;
        border: none;
        cursor: pointer;
        transition: all 0.3s ease;
        min-height: 44px;

        &.cancel-button {
          background: white;
          border: 2px solid #d9d9d9;
          color: #666;
          z-index: 1000;
          &:hover {
            border-color: #1890ff;
            color: #1890ff;
            transform: translateY(-1px);
          }

          &:active {
            transform: translateY(0);
          }
        }

        &.confirm-button {
          background: linear-gradient(135deg, #1890ff, #40a9ff);
          color: white;
          box-shadow: 0 4px 15px rgba(24, 144, 255, 0.3);
          z-index: 1000;
          &:hover {
            transform: translateY(-2px);
            box-shadow: 0 6px 20px rgba(24, 144, 255, 0.4);
          }
          &:active {
            transform: translateY(0);
          }
        }
      }
    }
  }

// 动画效果
@keyframes bounce {
  0%, 20%, 50%, 80%, 100% {
    transform: translateY(0);
  }
  40% {
    transform: translateY(-8px);
  }
  60% {
    transform: translateY(-4px);
  }
}

@keyframes thinking {
  0%, 100% {
    transform: rotate(0deg);
  }
  25% {
    transform: rotate(-5deg);
  }
  75% {
    transform: rotate(5deg);
  }
}

@keyframes gift {
  0%, 100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.1);
  }
}

@keyframes shake {
  0%, 100% {
    transform: translateX(0);
  }
  25% {
    transform: translateX(-2px);
  }
  75% {
    transform: translateX(2px);
  }
}

@keyframes celebrate {
  0%, 100% {
    transform: scale(1) rotate(0deg);
  }
  25% {
    transform: scale(1.1) rotate(-5deg);
  }
  50% {
    transform: scale(1.2) rotate(0deg);
  }
  75% {
    transform: scale(1.1) rotate(5deg);
  }
}

// 星星闪烁动画
@keyframes twinkle {
  0%, 100% {
    opacity: 0.3;
    transform: scale(1);
  }
  50% {
    opacity: 1;
    transform: scale(1.2);
  }
}

// success图标脉冲动画
@keyframes successPulse {
  0%, 100% {
    transform: translate(-50%, -50%) scale(1);
    opacity: 0.8;
  }
  50% {
    transform: translate(-50%, -50%) scale(1.1);
    opacity: 1;
  }
}
